package com.woniuxy.service.impl;

import com.woniuxy.entity.Category;
import com.woniuxy.mapper.CategoryMapper;
import com.woniuxy.service.CategoryService;
import com.woniuxy.utils.ResponseResults;
import com.woniuxy.utils.ResponseState;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class CategoryServiceImpl implements CategoryService {

    @Resource
    private CategoryMapper categoryMapper;

    @Override
    public ResponseResults<List<Category>> add() {
        return new ResponseResults<List<Category>>()
                .setCode(200)
                .setState(ResponseState.SELECT_SUCCESS)
                .setMsg("查询成功！")
                .setData(categoryMapper.addAll());
    }
}
